lcPaint_ImageSetPixel Home

Sets color of specified pixel in a raster image object.

 BOOL lcPaint_ImageSetPixel (
   HANDLE hImage,
   int X,
   int Y,
   int Red,
   int Green,
   int Blue
 );

Parameters
hImage
  Handle to raster image object.
X Y
  Pixel coordinates.
Red Green Blue
  Color components (0-255).

Return Value

  If the function succeeds, the return value is nonzero (TRUE).

See Also

  lcPaint_ImageCreate


Code sample:
//-----------------------------------------------
void LcAppDemo01::LoadImages ()
{
  ...
  // programmatically generated image
  hImage = lcPaint_ImageAdd( 41 );
  W = 30;
  H = 20;
  lcPaint_ImageCreate( hImage, W, H );
  // set pixels
  B = 0;
  srand( (unsigned)time(0) );
  for (x=0; x<W; x++){
    for (y=0; y<H; y++){
      R = (int)(255.0 * ((double)rand()/RAND_MAX));
      G = (int)(255.0 * ((double)rand()/RAND_MAX));
      B = (int)(255.0 * ((double)rand()/RAND_MAX));
      lcPaint_ImageSetPixel( hImage, x, y, R,G,B );
    }
  }
}